<div class="main_body">
	<div id="left_column">
    <?php echo $this->element('main_menu')?>
    </div>	
	<div id="main_body_content">		
		
		<div class="ordersBillings view">
		<h1><?php  __("Employee");?></h1>
			<dl><?php $i = 0; $class = ' class="altrow"';?>
				<dt<?php if ($i % 2 == 0) echo $class;?>><?php __("Id"); ?></dt>
				<dd<?php if ($i++ % 2 == 0) echo $class;?>>
					<?php echo $employee['Employee']['id']; ?>
					&nbsp;
				</dd>
				<dt<?php if ($i % 2 == 0) echo $class;?>><?php __("First Name"); ?></dt>
				<dd<?php if ($i++ % 2 == 0) echo $class;?>>
					<?php echo $employee['Employee']['name']; ?>
					&nbsp;
				</dd>
				<dt<?php if ($i % 2 == 0) echo $class;?>><?php __("Last Name"); ?></dt>
				<dd<?php if ($i++ % 2 == 0) echo $class;?>>
					<?php echo $employee['Employee']['surname']; ?>
					&nbsp;
				</dd>
				<dt<?php if ($i % 2 == 0) echo $class;?>><?php __("Address 1"); ?></dt>
				<dd<?php if ($i++ % 2 == 0) echo $class;?>>
					<?php echo $employee['Employee']['address1']; ?>
					&nbsp;
				</dd>
				<dt<?php if ($i % 2 == 0) echo $class;?>><?php __("Address 2"); ?></dt>
				<dd<?php if ($i++ % 2 == 0) echo $class;?>>
					<?php echo $employee['Employee']['address2']; ?>
					&nbsp;
				</dd>
				<dt<?php if ($i % 2 == 0) echo $class;?>><?php __("City"); ?></dt>
				<dd<?php if ($i++ % 2 == 0) echo $class;?>>
					<?php echo $employee['Employee']['address3']; ?>
					&nbsp;
				</dd>
				<dt<?php if ($i % 2 == 0) echo $class;?>><?php __("State"); ?></dt>
				<dd<?php if ($i++ % 2 == 0) echo $class;?>>
					<?php echo $employee['Employee']['address4']; ?>
					&nbsp;
				</dd>
				<dt<?php if ($i % 2 == 0) echo $class;?>><?php __("Zip code"); ?></dt>
				<dd<?php if ($i++ % 2 == 0) echo $class;?>>
					<?php echo $employee['Employee']['address5']; ?>
					&nbsp;
				</dd>	
				<dt<?php if ($i % 2 == 0) echo $class;?>><?php __("Phone"); ?></dt>
				<dd<?php if ($i++ % 2 == 0) echo $class;?>>
					<?php echo $employee['Employee']['phone1']; ?>
					&nbsp;
				</dd>
			</dl>
		</div>
		<div class="clr"></div>
		
		<div class="ordersBillings index">
			<h1><?php __("Orders Billings");?></h1>
			<?php echo $this->Form->create('OrdersBilling');?>
			
			<table cellpadding="0" cellspacing="0">
			<tr>
				<th><?php echo __("Order",true);?></th>
				<th><?php echo __("Date",true);?></th>
				<th><?php echo __("Salary [USD]",true);?></th>
				<th class="actions"><?php __("Actions");?></th>
			</tr>
			<?php
			$i = 0;
			$pay_value = 0;
			foreach ($ordersSeries as $oneSeries):
				$class = null;
				if ($i++ % 2 == 0) {
					$class = ' class="altrow"';					
				}
				$pay_value = $pay_value + $oneSeries['OrdersSeries']['employee_salary'];
			?>
			<tr<?php echo $class;?>>
				<td>
					<?php echo $this->Html->link($oneSeries['Orders']['name'], array('controller' => 'orders', 'action' => 'view', $oneSeries['Orders']['id'])); ?>
					<?php echo $this->Form->hidden("OrdersSeries.{$oneSeries['OrdersSeries']['id']}.orders_id",array('value'=>$oneSeries['OrdersSeries']['id']));?>
				</td>
				<td><?php echo $time->format('m-d-Y',$oneSeries['OrdersSeries']['execution_date']); ?>&nbsp;</td>
				<td align="right"><?php echo $oneSeries['OrdersSeries']['employee_salary']; ?>&nbsp;</td>
				<td class="actions">
					<?php echo $this->Html->link($html->image(HOST.'/actions_16_view.png'), array('controller'=>'orders_series','action' => 'view', $oneSeries['OrdersSeries']['id']),array('title'=>__("View", true),'escape'=>false)); ?>
				</td>
			</tr>
		<?php endforeach; ?>
			<tr>
				<th colspan="2"><?php echo __("Total Salary",true);?></th>
				<th align="right"><?php echo $pay_value?></th>
				<th class="actions" align="right">
					<div style="display: none;">
					<?php
						echo $this->Form->hidden('pay_number');
						echo $this->Form->hidden('pay_nout');
						echo $this->Form->hidden('pay_value',array('value'=>$pay_value));
						echo $this->Form->hidden('employee_id');
						echo $this->Form->hidden('date_from');
						echo $this->Form->hidden('date_to');
						echo $this->Form->hidden('save_to_database',array('value'=>'confirm'));
					?>						
					</div>
					
				</th>
			</tr>		
			</table>
			<?php echo $this->Form->end(__("Submit", true));?>
		</div>
		
		<div class="clr"></div>	
	</div>		
	<?php echo $this->element('languages')?>	
	<div class="clr"></div>
	<br/>
</div>	
<div class="clr"></div>	
<div class="main_action">
	<div class="main_action_content">
			
		<div class="actions">
			<h3><?php __("Actions"); ?></h3>
			<ul>
				<li><?php echo $this->Html->link($html->image(HOST.'/actions_billings_index.png'), array('action' => 'index'),array('title'=>__("List Orders Billings", true),'escape'=>false)); ?><div class="clr"></div><?php echo __("List Orders Billings", true)?></li>
				<li><?php echo $this->Html->link($html->image(HOST.'/actions_billings_add.png'), array('action' => 'add'),array('title'=>__("New Orders Billing", true),'escape'=>false)); ?><div class="clr"></div><?php echo __("New Orders Billing", true)?></li>
			</ul>
		</div>

		<div class="clr"></div>
	</div>		
</div>			